import request from '../utils/axios';
import qs from "qs";

//角色数据
export function roleData(query) {
    return request({
        url: '/role/list?' + qs.stringify(query),
        method: 'get'
    });
};

//角色数据
export function deleteRole(roleId) {
    return request({
        url: '/role/delete/' + roleId,
        method: 'delete'
    })
};

export function exitRole(param) {
    return request({
        url: '/role/update?' + qs.stringify(param),
        method: 'put'
    })

};

export function addRole(param) {
    return request({
        url: '/role/add?' + qs.stringify(param),
        method: 'post'
    })
};

export function getrs(roleId) {
    return request({
        url: '/role/getResource/' + roleId,
        method: 'get'
    })
}

export function exportExeclRole() {
    return request({
        url: '/role/execl',
        method: 'get'
    })

};

export function batchAdd(roleId, ids) {
    return request({
        url: '/role/batchAddRoleResource?roleId=' + roleId + "&ids=" + ids,
        method: 'post'
    })
};

